home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / qwik30.arc / CURSOR.DOC next >
Text File  |  1991-01-09  |  5KB  |  92 lines

  1. { Cursor.doc - documentation for Cursor.inc                 ver 3.0, 08-31-87 }
  2.  
  3.   GotoRC - Like Turbo's GotoXY, this procedure moves the cursor, but with a 
  4.   couple of important differences.  The cursor is always relative to the 
  5.   entire screen and ignores the limits set by the Turbo Window procedure.  In 
  6.   addition, it will work on all the other video pages besides page 0.
  7.  
  8.   CursorChange - This procedure will let you change the mode (shape and 
  9.   visibility) of the cursor.  At the same time, it saves the previous mode.  
  10.   Using hex is the easiest way to set the integer.  The shape of the cursor 
  11.   is defined by horizontal scan lines in the character cell where the top row 
  12.   is of any cell is 0.  The starting (upper) row of the cursor mode is the 
  13.   high (or left) byte of the integer and the ending (lower) row is the low 
  14.   (or right) byte.  In addition, bits 5 and 6 of the starting row byte 
  15.   control on/off and erratic blinking (remember a byte has bits 0 to 7).  See 
  16.   QINIT.DOC for cell sizes.
  17.  
  18.      Shape:       Adapter   Default  Comments
  19.                   --------  -------  -------------------------
  20.                   MDA       $0B0C
  21.                   CGA,MCGA  $0607
  22.                   EGA       $0B0C    MD, ECD (640x350 25-line)
  23.                   EGA       $0607    CD, ECD (640x200)
  24.                   VGA       $0D0E    Emulation off
  25.  
  26.      Cursor off:  Set start row bits 6-5 = 01.  All other bits don't matter.
  27.      Blinking:    Set start row bits 6-5 = 11.  Creates erratic blinking on 
  28.                   most machines.
  29.  
  30.      Suggestions: For block cursor, set New:=$000D   (Works on all machines.)
  31.                   For hidden cursor, set New:=$2000
  32.  
  33.   CursorOff - Rather than using CursorChange to hide the cursor, use this 
  34.   procedure.  You don't have to save the current cursor shape since all it 
  35.   does is set the cursor-off bit on the current cursor mode.
  36.  
  37.   CursorOn - To restore the cursor after turning it off with CursorOff, use 
  38.   this procedure.  The previous shape is maintained.
  39.  
  40.   Suggestions - Use discretion when changing the cursor mode.  Some users 
  41.   prefer a block cursor for all their applications.  If your program forces 
  42.   it to an underline, try to restore the original cursor.  Programs like 
  43.   Turbo and WordStar, never even touch the cursor.  There is only one case 
  44.   that I know where you must set the cursor mode before using CursorOff/On.  
  45.   The early PCs had a bug in the BIOS that set the MDA default to be CGA 
  46.   instead.  You can check for ActiveDD=MdaMono and a $0607 cursor.  If so, 
  47.   change it to $0B0C for an underline.
  48.  
  49.   EGA Cursor Emulation - With 640x200, the emulation works fairly well.  With 
  50.   640x350 and 25-line mode, the emulation works, too.  Outside of that, it is 
  51.   suggested that any needed changes should be made with emulation off which 
  52.   can be done be setting bit 0 of EgaInfo equal to 1.
  53.  
  54.   MCGA Cursor Emulation - Use the CGA cursor cell size even though the 
  55.   character cell is 8x16.  The BIOS multiplies the start and end rows by 2 
  56.   and then adds one to the end row before writing to the hardware video port 
  57.   to emulate the CGA.
  58.  
  59.   VGA Cursor Emulation - Qinit sets the cursor emulation mode on so you don't 
  60.   have to worry about special fonts and cells sizes.  The only cell sizes you 
  61.   need to know is the MDA and CGA.  The video BIOS will adjust your cursor 
  62.   shape to fit in the current cell size.  Here's the cursor shapes (types) 
  63.   recognized by the VGA algorithm and how it responds:
  64.  
  65.      Cursor Type   Condition            Action
  66.      ------------  -------------------  ---------------
  67.      Hidden (off)  start bits 6-5 = 01  pass
  68.      Split         start > end          invert to block
  69.      Overbar       start < end <= 3     pass
  70.      Underline     start+2 >= end       adjust
  71.      Full-block    start <= 2           adjust
  72.      Half-block    start > 2            adjust
  73.  
  74.  
  75.   For adjustment, three more tests are required:
  76.  
  77.      Condition                          Action
  78.      --------------------------------   ----------
  79.      start or end >= cell height        adjust
  80.      end = cell height - 1              pass
  81.      start = cell height - 2            pass
  82.  
  83.  
  84.   The final adjustment is made to the corresponding cursor type:
  85.  
  86.      Cursor Type  Adjustment
  87.      -----------  -------------------------------------------------
  88.      Overbar      pass
  89.      Underline    move start/end to bottom of cell
  90.      Half-block   start = cell height/2; move end to bottom of cell
  91.      Full-block   move end to bottom of cell
  92.